<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
    </h:head>
    <h:body>
        <h:form enctype="multipart/form-data">
            <h:dataTable value="#{surveyBean.surveys}" var="survey">
                <h:column>
                    <f:facet name="header">Results</f:facet>
                    <h:inputFile value="#{survey.resultsFilePart}" />
                    <h:commandButton value="Upload" />
                </h:column>
                <h:column>
                    <f:facet name="header">Semester</f:facet>
                    <h:inputText  required="true" value="#{survey.semester}" />
                </h:column>
                <h:column>
                    <f:facet name="header">Group</f:facet>
                    <h:inputText  required="true" value="#{survey.groupBelong}" />
                </h:column>
                <h:column>
                    <h:inputText  required="true" value="#{survey.initiator}" />
                </h:column>
                <h:column>
                    <f:facet name="header">Degree Programs</f:facet>
                    <h:selectManyCheckbox value="#{survey.ownDegreePrograms}">
                        <f:selectItems value="#{survey.allDegreePrograms}" var="coda"
                                       itemLabel="#{coda}" itemValue="#{coda}" />
                    </h:selectManyCheckbox>
                </h:column>
                <h:column>    	    
                    <f:facet name="header">Target Attainment Levels</f:facet>  
                    <h:selectOneMenu value="#{survey.currentPEO}">
                        <f:selectItem itemValue="" itemLabel="select"/> 
                        <f:selectItems value="#{surveyBean.peoAttainmentLevel}"/> 
                    </h:selectOneMenu>
                    <h:form>
                        <h:inputText value="#{survey.currentAttainment}">
                            <f:convertNumber integerOnly="true"></f:convertNumber>
                        </h:inputText>
                        <h:commandButton id="attainment" value="Save" actionListener="#{surveyBean.saveAttainment}"/>
                    </h:form>
                </h:column>
            </h:dataTable>
            <h:commandButton id='submit' value="Submit" action="#{surveyBean.saveSurveys()}" />
        </h:form>
    </h:body>
</html>

